﻿using System;

public class UnitFactory
{
    public static UnitFactory Instance
    {
        get
        {
            if (instance == null)
                instance = new UnitFactory();

            return instance;
        }
    } static UnitFactory instance;

    public T Create<T>(string name) where T : Unit, new()
    {
        var u = new T();
        u.Name = name;
        return u;
    }
}